﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using octopus_project.enumeration;
using Microsoft.Xna.Framework;
using octopus_project.scene.cannon.weapon;

namespace octopus_project.tileset.mapCells {
    class MiniCannon_MapCell : MapCell{

        private MiniCannon cannon;

        public MiniCannon_MapCell(MiniCannon miniCannon) {
            tileType = TileType.PLAYER_MINI_CANNON;
            StrongCell = new StrongCell(5);
            cannon = miniCannon;
        }

        public override void paint(SpriteBatch spriteBatch, int x, int y, TileMap_GameplayEntry map) {
            spriteBatch.Draw(
                TileTypeExtensions.SpriteImage,
                new Rectangle(x * Constant.TILE_SIDE, y * Constant.TILE_SIDE, Constant.TILE_SIDE, Constant.TILE_SIDE),
                TileTypeExtensions.GetSourceRectangle(TileType.PLAYER_CONQUERED, player.Color),
                Color.White);

                spriteBatch.Draw(
                    TileTypeExtensions.SpriteImage,
                    new Rectangle(x * Constant.TILE_SIDE, y * Constant.TILE_SIDE, Constant.TILE_SIDE, Constant.TILE_SIDE),
                    TileTypeExtensions.GetSourceRectangle(TileType.PLAYER_MINI_CANNON, player.Color),
                    Color.White);


        }
        public override bool isWeapon() {
            return true;
        }
        public override MapCell change(TileType tileTypeParam) {
            return this;
        }
        /// <summary>
        /// Cuando cambia el estado conquistado del tile, es llamado este metodo.
        /// </summary>
        public override void changeConquered() {
            cannon.Enabled = conquered;
        }

    }
}
